define(["oms_config/root"],function($root){
	var tpl = {};
	/* 计划随访患者.列表 */
	tpl.init1 = function(){
		var config = $root.init();
		var html = '';
		html += eval(config.tpl.workBenchDiabetesBabyList);	// 配置在配置文件里的函数
		return html;
	};
	/* 计划随访患者.队列select */
	tpl.init2 = function(){
		var html = '';
		html += selectQueue();
		return html;
	};
	/* 今日门诊记录.右侧 */
	tpl.init3 = function(){
		var html = '';
		html += windowOperateList();
		return html; 
	};

	var BabyList = function(){
		return '<script id="tpl_workBenchBabyList" type="text/html">'+
				'	<div  class="col-sm-6 col-md-4 col-lg-3 dashboard-add">'+
				'		<div class="text-center" id="addPatient">'+
				'			<div style="padding-top:5px"><i class="fa fa-plus dashboard-add-icon"></i></div>'+
				'			<div class="dashboard-add-label">添加患者</div>'+
				'		</div>'+
				'	</div>'+
				'{{each rows as value i}}'+
				'	<div class="col-sm-6 col-md-4 col-lg-3 babycard clickbabycard" followQueueId="{{value.followQueueId}}" patientSchemeId="{{value.patientSchemeId}}" patientId="{{value.patientId}}">'+
				'		<div class="clearfix" style="padding-top:5px">'+
				'			<div class="pull-left babycard-icon clickbabycard-icon"><img src="page/followup/imgs/comm/{{if value.gender == "F"}}girl{{else}}boy{{/if}}.png"></div>'+
				'			<div class="pull-left babycard-name"><span class="clickbabycard-name ellipsis-1">{{value.patientName}}</span></div>'+
				'		</div>'+
				'		<div class="clearfix">'+
				'			<div class="babycard-tel"><span class="ellipsis-1">{{value.phoneNum}}</span></div>'+
				'			<div class="babycard-queuename ellipsis-1">{{value.followQueueName}}</div>'+
				'		</div>'+
				'	</div>'+
				'{{/each}}'+
				'{{each emptyRows as value i}}'+
				'	<div class="col-sm-6 col-md-4 col-lg-3 babycard"  > </div>'+
				'{{/each}}'+
				'</script>';
	};

	var BabyListAddProgress = function(){
		return '<script id="tpl_workBenchBabyList" type="text/html">'+
				'	<div  class="col-sm-6 col-md-4 col-lg-3 dashboard-add">'+
				'		<div class="text-center" id="addPatient">'+
				'			<div><i class="fa fa-plus dashboard-add-icon"></i></div>'+
				'			<div class="dashboard-add-label">添加患者</div>'+
				'		</div>'+
				'	</div>'+
				'{{each rows as value i}}'+
				'	<div class="col-sm-6 col-md-4 col-lg-3 babycard clickbabycard" followQueueId="{{value.followQueueId}}" patientSchemeId="{{value.patientSchemeId}}" patientId="{{value.patientId}}">'+
				'		<div class="clearfix">'+
				'			<div class="pull-left babycard-icon clickbabycard-icon"><img src="page/followup/imgs/comm/{{if value.gender == "F"}}girl{{else}}boy{{/if}}.png"></div>'+
				'			<div class="pull-left babycard-name"><span class="clickbabycard-name ellipsis-1">{{value.patientName}}</span></div>'+
				'		</div>'+
				'		<div class="clearfix">'+
				'			<div class="babycard-tel"><span class="ellipsis-1">{{value.phoneNum}}</span></div>'+
				'			<div class="babycard-queuename ellipsis-1">{{value.followQueueName}}</div>'+
				'		</div>'+
				// begin 假的进度条
				'		<div class="progress-wrap">'+
				'			{{each value.progressArr as val j}}'+
				'				<div style="width:9%">'+
				'					{{if val=="1"}}'+
				'						<i class="progress-finish"></i>'+
				'					{{else if val=="2"}}'+
				'						<i class="progress-overdue"></i>'+
				'					{{else if val=="3"}}'+
				'						<i class="progress-current"></i>'+
				'					{{else if val=="0"}}'+
				'						<i class="progress-notstart"></i>'+
				'					{{/if}}'+
				'				</div>'+
				'			{{/each}}'+
				'		</div>'+
				// end 假的进度条
				'	</div>'+
				'{{/each}}'+
				'{{each emptyRows as value i}}'+
				'	<div class="col-sm-6 col-md-4 col-lg-3 babycard"  > </div>'+
				'{{/each}}'+
				'</script>';
	};

	var selectQueue = function(){
		return 	'<script id="tpl_workBenchSelect" type="text/html">'+
				'	<select class="form-control">'+
				'	  	<option value="">全部</option>'+
				'		{{each rows as value i}}'+
				'	  		<option value="{{value.id}}">{{value.queueName}}</option>'+
				'		{{/each}}'+
				'	</select>'+
				'</script>';
	}
	var windowOperateList = function(){
		return 	'<script id="tpl_workBenchOperateList" type="text/html">'+
				'{{each rows as value i}}'+
				'	<div class="clearfix baby-done" patientId="{{value.patientId}}">'+
				'		<div class="col-sm-6 col-md-6 ellipsis-1">{{value.patientName}}</div>'+
				'		<div class="col-sm-6 col-md-6 ellipsis-1 text-right color-9">{{value.dealTime}}</div>'+
				'	</div>'+
				'{{/each}}'+
				'</script>';
	}

	return tpl;
});